package cliente.responsehandler;

import org.apache.http.StatusLine;
import org.apache.http.client.ClientProtocolException;

/**
 * Specific exception that contains http response code and reason phrase, for non 200 (OK) responses.
 */
public class NonOkResponseException extends ClientProtocolException {

    private int code;
    private String reason;

    public NonOkResponseException(StatusLine statusLine) {
        this.code = statusLine.getStatusCode();
        this.reason = statusLine.getReasonPhrase();
    }

    public int getCode() {
        return code;
    }

    public String getReason() {
        return reason;
    }
}
